<template>
    <div>
        <h2>Home</h2>
        {{ cartStore.count }}
        <button @click="cartStore.count++">count++</button>
        <hr>
        {{ shopStore.age }}
        <button @click="shopStore.age++">age++</button>
        <button @click="shopStore.$reset()">reset</button>

        <button @click="shopStore.$patch({
            title: 'hello jack',
            age: 100
        })">patch</button>

        <button @click="shopStore.$patch((state) => {
            state.title = 'hello lili';
            state.age = 200
        })">funtion patch</button>

        <hr>

        {{ shopStore.time('hi') }}
        {{ shopStore.num }}

        <hr>

        <button @click="cartStore.say()">cartStore.say</button>
    </div>
</template>
<script setup>

import { useCartStore, useShopStore } from '../stroe/shop.js'
const cartStore = useCartStore();
const shopStore = useShopStore();



</script>